package com.example.mymvp;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ListView;

import com.example.mymvp.View.StartVIew;
import com.example.mymvp.presenter.StartPresenter;

import java.util.List;

public class MainActivity extends AppCompatActivity implements StartVIew {
private ListView ls;
private Adapter adapter;
StartPresenter startPresenter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ls = findViewById(R.id.ls);
        startPresenter = new StartPresenter(this);
        startPresenter.fetch();
    }

    @Override
    public void showerr(String err) {

    }

    @Override
    public void showsatartlist(List<Start> list) {
        adapter = new Adapter(MainActivity.this,R.layout.item,list);
        ls.setAdapter(adapter);
    }
}